package net.vkits.api;

import net.vkits.admin.application.RateApplicationService;
import net.vkits.admin.domain.model.Rate;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

/**
 * Created by ethan-liu on 2017/1/14.
 */
@Controller
public class RatesApiController implements RatesApi {

    @Resource
    private RateApplicationService rateApplicationService;

    @Override
    public ResponseEntity<Rate> getRates() {
        Rate rate = rateApplicationService.getRate();
        return new ResponseEntity<>(rate, HttpStatus.OK);
    }
}
